import lazyLoadView from '@/router/lazy-load';

import { AppRouteRecordRaw } from '../types';
import { DEFAULT_LAYOUT } from '../base';

const Service: AppRouteRecordRaw = {
  path: '/service', // 路由地址
  name: 'Service',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.service',
    requiresAuth: false,
    icon: 'icon-settings',
    order: 999,
    roleCode: 'GROUP_SYSTEM_ADMIN',
  }, // 是否显示
  children: [
    {
      path: 'service-classification', // 路由地址
      name: 'ServiceClassification',
      component: lazyLoadView(
        () =>
          import('@/views/service-management/service-classification/index.vue')
      ),
      meta: {
        locale: 'menu.service.service-classification',
        requiresAuth: false,
        order: 999,
        roleCode: 'GROUP_SYSTEM_ADMIN',
        pageName: '服务分类',
      },
    },
    {
      path: 'service-items', // 路由地址
      name: 'ServiceItems',
      component: lazyLoadView(
        () => import('@/views/service-management/service-items/index.vue')
      ),
      meta: {
        locale: 'menu.service.service-items',
        requiresAuth: false,
        order: 999,
        roleCode: 'GROUP_SYSTEM_ADMIN',
        pageName: '服务项目',
      },
    },
    {
      path: 'service-plan', // 路由地址
      name: 'ServicePlan',
      component: lazyLoadView(
        () => import('@/views/service-management/service-plan/index.vue')
      ),
      meta: {
        locale: 'menu.service.service-plan',
        requiresAuth: false,
        order: 999,
        roleCode: 'GROUP_SYSTEM_ADMIN',
        pageName: '服务计划',
      },
    },
    {
      path: 'service-plan-create',
      name: 'ServicePlanCreate',
      meta: {
        locale: 'menu.service.servicePlanCreate',
        requiresAuth: false,
        roleCode: 'GROUP_SYSTEM_ADMIN',
        hideInMenu: true,
        extra: true,
        layout: 'detail',
      },
      component: lazyLoadView(
        () => import('@/views/service-management/service-plan/create.vue')
      ),
    },
    {
      path: 'service-record', // 路由地址
      name: 'ServiceRecord',
      component: lazyLoadView(
        () => import('@/views/service-management/service-record/index.vue')
      ),
      meta: {
        locale: 'menu.service.service-record',
        requiresAuth: false,
        order: 999,
        roleCode: 'GROUP_SYSTEM_ADMIN',
        pageName: '服务记录',
      },
    },
  ],
};
export default Service;
